﻿namespace NDK.Motion.MachineResources
{
    public interface ICylinder
    {
        /// <summary>
        /// Cylinder Name
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// 停止，双控气缸有用
        /// </summary>
        /// <returns></returns>
        bool? Stop();
        /// <summary>
        /// Cylinder Home
        /// </summary>
        bool Home();
        /// <summary>
        /// Cylinder Work
        /// </summary>
        bool Work();
        /// <summary>
        /// 等待气缸到Home位
        /// </summary>
        /// <param name="timeout">超时时间</param>
        /// <returns>true：超时</returns>
        bool WaitHome(int timeout = int.MaxValue);
        /// <summary>
        /// 等待气缸到Work位
        /// </summary>
        /// <param name="timeout">超时时间</param>
        /// <returns>true：超时</returns>
        bool WaitWork(int timeout = int.MaxValue);
        /// <summary>
        /// 设置气缸到Work位，并等待气缸到Work位
        /// </summary>
        /// <param name="timeout">超时时间</param>
        /// <param name="IsWait">是否判断到位</param>
        /// <returns>true：超时</returns>
        bool WorkAndWaitDone(int timeout = int.MaxValue, bool IsWait = true);
        /// <summary>
        /// 设置气缸到Home位，并等待气缸到Home位
        /// </summary>
        /// <param name="timeout">超时时间</param>
        /// <param name="IsWait">是否判断到位</param>
        /// <returns>true：超时</returns>
        bool HomeAndWaitDone(int timeout = int.MaxValue, bool IsWait = true);
        /// <summary>
        /// 气缸Home位状态
        /// </summary>
        /// <returns></returns>
        bool? isHomed();
        /// <summary>
        /// 气缸Work位状态
        /// </summary>
        /// <returns></returns>
        bool? isWorked();

    }
}
